package learnjava.concur.chapter123;

//import org.openjdk.jol.info.ClassLayout;
//
//
//import java.util.Vector;
//import java.util.concurrent.locks.LockSupport;
//
//public class TestBiasedLock {
//    static Thread t1, t2;
//    public static void main(String[] args) {
//        Logger logger = LoggerFactory.getLogger("");
//        Vector<Dog> list = new Vector<>();
//        t1 = new Thread(()->{
//            for (int i = 0; i < 1; i++) {
//                Dog d = new Dog();
//                list.add(d);
//                synchronized (d){
//                    logger.info(i+"\t"+ClassLayout.parseInstance(d).toPrintable());
//                }
//            }
//            LockSupport.unpark(t2);
//        },"t1");
//        t1.start();
//
////        t2 = new Thread(()->{
////            LockSupport.park();
////            for (int i = 0; i < 30; i++) {
////                Dog d = list.get(i);
////                logger.info(i+"\t"+ClassLayout.parseInstance(d).toPrintable());
////                synchronized (d){
////                    logger.info(i+"\t"+ClassLayout.parseInstance(d).toPrintable());
////                }
////                logger.info(i+"\t"+ClassLayout.parseInstance(d).toPrintable());
////            }
////        },"t2");
////        t2.start();
//    }
//}
//
//class Dog{
//
//}
